<!--
 * @Author: ltl
 * @Date: 2023-8-17 11:07:23
 * @LastEditors: ltl
 * @LastEditTime: 2023-8-17 11:07:27
 * @Description: 个人中心页面头部-优学高手
-->
<template>
  <div class="userVip" @click="goVipOpen">
    <div class="vipBac">
      <div class="vipBac_top">
        <div class="vipBac_top_left">
          <img class="crown" src="../../assets/images/user/crown.png" alt="">
          <div class="openVip" v-if="vipData.suitesState === '1' || vipData.suitesState === '2'">
            <span class="openVip_top">尊享{{ vipData.memberSuitesName }},{{ goReplace(vipData.disableTime) }}</span>
            <span class="openVip_bottom">已有{{ vipData.chargeCount }}家长为孩子开通优教会员</span>
          </div>
          <span class="vipCenter" v-else>VIP会员中心</span>
        </div>
        <div class="removeObstaclesFrom">立即{{ (vipData.suitesState === '1' || vipData.suitesState === '2') ? '查看' : '开通' }}</div>
      </div>
      <div class="vip_bottom">
        <div class="synchronous">
          <img src="../../assets/images/user/synchronous.png" alt="">
          <span>同步高手</span>
        </div>
        <div class="synchronous">
          <img src="../../assets/images/user/special.png" alt="">
          <span>专项高手</span>
          </div>
          <div class="synchronous">
          <img src="../../assets/images/user/WithdrawalPoints.png" alt="">
          <span>提分高手</span>
          </div>
      </div>
    </div>
  </div>
</template>

<script>
import { externalLinkServices } from '@/api';
export default {
  data () {
    return {
    };
  },
  props: {
    vipData: {
      type: Object
    }
  },
  methods: {
    goVipOpen () {
      window.location.href = externalLinkServices.vipList;
    },
    goReplace (data) {
      if (data) {
        return data.replace(/-/g, '/').substring(0, 10);
      } else {
        return '';
      }
    }
  }
};
</script>
<style lang="scss" scoped>
.userVip{
  margin-top: -70px;
  z-index: 999;
  padding: 0 18px;
  box-sizing: border-box;
  width: 100%;
  height: 136px;
  .vipBac{
    position: relative;
    width: 100%;
    height: 100%;
    background: url('../../assets/images/user/VipBac.png') no-repeat;
    background-size: 100% 100%;
    .vipBac_top{
      height: 60px;
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      padding: 12px 11px;
      box-sizing: border-box;
      .vipBac_top_left{
        display: flex;
        flex-direction: row;
        font-family: PingFangSC-Medium, PingFang SC, sans-serif;
        .crown{
          width: 30px;
          height: 30px;
        }
        .vipCenter{
          line-height: 30px;
          font-size: 17px;
          font-weight: 500;
          color: #6E4E18;
        }
        .openVip{
          line-height: 17px;
          width: 198px;
          position: relative;
          font-size: 13px;
          .openVip_top{
            font-size: 14px;
            font-weight: 500;
            color: #6E4E18;
          }
          .openVip_bottom{
            position: absolute;
            left: -17px;
            display: block;
            transform: scale(0.8);
            font-size: 12px;
            font-weight: 400;
            color: #b18232;
          }
        }
      }
      .removeObstaclesFrom{
        width: 70px;
        height: 25px;
        text-align: center;
        line-height: 25px;
        font-size: 12px;
        color: #fff;
        background: linear-gradient(90deg, #E5B668 0%, #C58E5C 100%);
        border-radius: 27px;
      }
    }
    .vip_bottom{
      display: flex;
      flex-direction: row;
      justify-content: space-around;
      .synchronous{
        text-align: center;
        img{
          width: 33px;
          height: 33px;
          vertical-align: middle;
        }
        span{
          margin-top: 7px;
          font-size: 13px;
          display: block;
          vertical-align: middle;
          font-family: PingFangSC-Regular, PingFang SC, sans-serif;
          font-weight: 400;
          color: #815121;
        }
      }
    }
  }
}
</style>
